package interviewpreparationkit.dictionary

/**
 * [Two Strings](https://www.hackerrank.com/challenges/two-strings)
 */
// Complete the twoStrings function below.
fun twoStrings(s1: String, s2: String): String {
    val s1Set = s1.toSet()
    val s2Set = s2.toSet()

    for (c in s2Set) {
        if (s1Set.contains(c)) {
            return "YES"
        }
    }
    return "NO"
}